<?php

namespace App\Models\Ca;

use App\Models\BaseModel;

class CustomerLog extends BaseModel
{
    protected $table = 'ca__customer_logs';
    //新增
    const TYPE_CREATE = 1;
    //修改
    const TYPE_UPDATE = 2;
    //删除
    const TYPE_DELETE = 3;
    //就诊
    const TYPE_ARRIVING = 4;
    //住院
    const TYPE_HOSPITALIZATION = 5;
    //出院
    const TYPE_LEAVE_HOSPITAL = 6;
    //流失
    const TYPE_LOSS = 7;
    //领取
    const TYPE_RECEIVE = 8;
    //回访
    const TYPE_VISIT = 9;
    //话务交接
    const TYPE_HANDOVER_CALLER = 10;
    //线上签到
    const TYPE_ONLINE_ARRIVING = 11;
    //话务领取
    const TYPE_MEDICAL_RECEIVE = 12;

    const TYPE_MAP = [
        self::TYPE_CREATE => '新增',
        self::TYPE_UPDATE => '修改',
        self::TYPE_DELETE => '删除',
        self::TYPE_ARRIVING => '就诊',
        self::TYPE_HOSPITALIZATION => '住院',
        self::TYPE_LEAVE_HOSPITAL => '出院',
        self::TYPE_LOSS => '流失',
        self::TYPE_RECEIVE => '领取',
        self::TYPE_VISIT => '回访',
        self::TYPE_HANDOVER_CALLER => '话务交接',
        self::TYPE_ONLINE_ARRIVING => '线上签到',
        self::TYPE_MEDICAL_RECEIVE => '话务领取',
    ];

    protected $fillable = [
        'id',
        'user_id',
        'customer_id',
        'desc',
        'type',
        'change_data',
        'deleted_at',
        'updated_at',
        'created_at'
    ];

    protected $casts = [
        'change_data' => 'array'
    ];
}